let mongoose = require('./db')
// 点位管理-合作商规范
let Schema=mongoose.Schema
let cooperativeSchema = new Schema({
    name: String,// 名称
    ren:String,//联系人
    phone:String,//联系电话
    ratio:Number,//比例
    username:String,//账号
    password:String//密码
})
//点位管理-区域管理
let areaSchema=new Schema({
    name:String,
    bei:String
})
// 点位管理-点位管理
let pointSchema=new Schema({
    name:String,
    area:{
        type:mongoose.Types.ObjectId,
        ref:"area"
    },
    lei:String,
    cooperative:{
        type:mongoose.Types.ObjectId,
        ref:"cooperative"
    },
    di:Array,
    xidi:String,
})
// 合作商数据模型
let cooperativeModel=mongoose.model("cooperative",cooperativeSchema,"cooperative")
let areaModel=mongoose.model("area",areaSchema,"area")
let pointModel=mongoose.model("point",pointSchema,"point")
module.exports={
    cooperativeModel,
    areaModel,
    pointModel
}
